<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title></title>
	<link rel="stylesheet" href="">
</head>
<body>
<script src='http://cdn.jsdelivr.net/vue/1.0.26/vue.js'></script>
<script src='https://cdn.jsdelivr.net/vue.router/0.7.10/vue-router.min.js'></script>
<div id="root">
	<div>
		{{fullName}}
	</div>
</div>
<script>
	var vm = new Vue({
		el : '#root',
		data : {
			firstName : 'Li',
			lastName : 'Jin Wen',
			fullName : 'Li Jin Wen',
		},
	});
	vm.$watch('firstName',function(val){//检测firstName是否变化
		this.fullName = val + ' ' + this.lastName;
	});
	vm.$watch('lastName',function(val){//检测lastName是否变化
		this.fullName = val + ' ' + this.firstName;
	})
</script>	
</body>
</html>